﻿@model Web
@{
    ViewBag.Title = "SiteLogo";
    Layout = "~/Views/Shared/_Dashboard.cshtml";
}
@UIHelper.ImageTitle(Html.Global("RES_SITE_LOGOANDICON"), Html.Global("RES_SITE_LOGOANDICON_DESC"), Url.Content("~/content/images/icon_logo_48.png"))
@using (Html.BeginForm())
{
 
    @UIHelper.SectionHeader(Html.Global("RES_LOGO"))
    <div class="d-field-description">
        @Html.Global("RES_WEBSITE_LOGO_TIPS")
    </div>
    
    if (!string.IsNullOrEmpty(Model.LogoImageUrl))
    {    <div>
        <img src="@Url.Content(Model.LogoImageUrl)" alt="" />
    </div>
    }
    <dl>
        <dd class="ui-helper-reset">
            @Html.Global("RES_DISP"):
        </dd>
        <dd class="ui-helper-reset">
            @(Ajax.Dna().ComboBox("Web.LogoLayout")
                               .Width(300)
                               .DropDownStyle(DropdownStyles.DropdownList)
                               .Select(Model.LogoLayout == 0 ? LogoLayouts.TitleOnly.ToString() : Model.LogoLayout.ToString())
                               .Items(items =>
                               {
                                   items.AddValue(Html.Global("LogoLayouts_TitleOnly"), LogoLayouts.TitleOnly.ToString());
                                   items.AddValue(Html.Global("LogoLayouts_LogoOnly"), LogoLayouts.LogoOnly.ToString());
                                   items.AddValue(Html.Global("LogoLayouts_LogoAndTitle"), LogoLayouts.LogoAndTitle.ToString());
                                   items.AddValue(Html.Global("LogoLayouts_LogoWithRB"), LogoLayouts.LogoWithTitleRightBottom.ToString());
                                   items.AddValue(Html.Global("LogoLayouts_LogoWithRT"), LogoLayouts.LogoWithTitleRightTop.ToString());
                                   items.AddValue(Html.Global("LogoLayouts_LogoWithTitleBelow"), LogoLayouts.LogoWithTitleBlow.ToString());
                               })
                               .GetHtml()
                         )
        </dd>
        <dd class="ui-helper-reset">
            &nbsp;</dd>
        <dd class="ui-helper-reset">
            Url:</dd>
        <dd class="ui-helper-reset">
            <table>
                <tr>
                    <td>
                        @( Ajax.DnaFor().TextBox(m => m.LogoImageUrl)
                                    .Width(300)
                                    .IconImageUrl(Url.Content("~/content/images/icon_link_16.png"))
                                    .GetHtml()
                            )
                    </td>
                    <td>@Ajax.Dna().Button("btnBrowseLogo").LocText("RES_BROWSE").Click("_fileDlg(\"#Web_LogoImageUrl\");").ImageIcons(Url.Content("~/content/images/icon_folder_open_16.gif")).GetHtml()
                    </td>
                </tr>
            </table>
        </dd>
    </dl>
    @UIHelper.SectionHeader(Html.Global("RES_SHORTCUTICON"))
    <div class="d-field-description">
        @Html.Global("RES_SHOTCUTICON_TIPS")
    </div>
    <div style="margin: 5px 0px;">
        <table>
            <tr>
                <td>
                    @Ajax.DnaFor().TextBox(m => m.ShortcutIconUrl).Width(300).IconImageUrl(Url.Content("~/content/images/icon_link_16.png")).GetHtml()
                </td>
                <td>@Ajax.Dna().Button("btnBrowseShotcut").LocText("RES_BROWSE").Click("_fileDlg(\"#Web_ShortcutIconUrl\");").ImageIcons(Url.Content("~/content/images/icon_folder_open_16.gif")).GetHtml()
                </td>
            </tr>
        </table>
    </div>
    <hr />
    
    @Ajax.Dna().Button().HtmlAttributes(new { style = "margin-top:10px;" }).Submit().ImageIcons(Url.Content("~/content/images/icon_save.gif")).LocText("RES_SAVE").GetHtml()
}
<script type="text/javascript">
    function _fileDlg(_el) {
      $dna.fileDlg("@Url.Action("Dialog", "WebFiles", new { Area = "", website = WebSiteContext.Current.Web.Name })", _el);
    }
</script>
